<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>component-2</title>
    <script type="text/javascript" src="../assets/js/vue-2.3.0.js"></script>    
</head>
<body>
    <h1>组件-2属性</h1>
    <hr>
    <div id="app">
        <melo :color="color"></melo>
        <wukong from="花果山"></wukong>
        <bajie :from='home'></bajie>
    </div>
</body>
<script type="text/javascript">
    //全局注册
    Vue.component('melo', {
        template:'<div style="color:orange;">全局注册标签 {{color}}</div>',
        props:['color']
    })

    var app = new Vue({
        el:"#app",
        data:{
            code:"wukong",
            color:'orange',
            home:'高老庄'
        },
        components:{
            "wukong":{
                template:'<div>悟空来自{{from}}</div>',
                props:['from']
            },
            "bajie":{
                template:"<div>八戒来自{{from}}</div>",
                props:['from']
            }
        }
    })

</script>
</html>